package com.liu.jdbc.myjdbc;

import com.mchange.v2.c3p0.ComboPooledDataSource;
import org.junit.Test;

import java.sql.Connection;
import java.sql.SQLException;

public class C3P0_ {
    @Test
    public void TestC3p0() throws SQLException {
        ComboPooledDataSource comboPooledDataSource = new ComboPooledDataSource("liu");
        long StartTime = System.currentTimeMillis();
        for (int i = 0; i < 5000; i++) {
            Connection connection = comboPooledDataSource.getConnection();
            connection.close();
        }
        long EndTime = System.currentTimeMillis();
        System.out.println("执行连接的时间"+ (EndTime - StartTime));
    }
}
